package com.qfedu.stussm.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;

    /**
     * 成功
     * @param data 返回的内容*/
    public static R ok(Object data){
        return new R(200,"OK",data);
    }
    /**
     * 成功*/
    public static R ok(){
        return new R(200,"OK",null);
    }
    /**
     * 失败*/
    public static R fail(){
        return new R(400,"FAIL",null);
    }
}
